package secondassigment;

import java.io.File;
//import java.io.FilenameFilter;
//import java.util.Scanner;

public class Find implements ICommandExecutor {
public void execute(String dirname) {
	
	String[] str_mas = dirname.split(">");
    String directory = str_mas[0];
    String SearchWord = str_mas[1];
	
	//Scanner scan = new Scanner(System.in);
	 
    File folder = new File(directory);
	    if(!folder.exists()){
	        System.out.println("Directory not found: " + directory);
	} else
	//System.out.println("word for search ");
    //String SearchWord = scan.nextLine();
  
    for (File f : folder.listFiles()) {
        if (f.getName().contains(SearchWord)) 
        	System.out.println(f.getName());
    }
}


}
